﻿using Loki.Data;

using Loki.Utils;

namespace Luna.Data.Configuration
{
    public class ConfigurationProvider : LokiDataProvider, IConfigurationProvider
    {
        //public ConnectorDataMapper ConnectorMapper { get; set; }

        public IRepositoryManager Manager { get; set; }

        #region Store Management

        public void CreateNewStore(string storeName)
        {
            Manager.Create(storeName);
        }

        public void OpenExistingStore(string storeName)
        {
            Manager.Open(storeName);
        }

        public void MoveCurrentStoreTo(string storeName)
        {
            Manager.SaveAs(storeName);
        }

        public void CloseCurrentStore()
        {
            Manager.DisposeIfDisposable();
        }

        #endregion Store Management

        /* #region Connectors

        public IEnumerable<IConnectorData> GetAllConnectors()
        {
            return WrapperTransactional(T => ConnectorMapper.GetAll(T));
        }

        public IConnectorData GetConnector(Guid connectorID)
        {
            return WrapperTransactional(T => ConnectorMapper.Get(T, connectorID));
        }

        public void SaveConnector(IConnectorData connector)
        {
            WrapperTransactional(T => ConnectorMapper.Save(T, connector));
        }

        public void DeleteConnector(Guid connectorID)
        {
            WrapperTransactional(T => ConnectorMapper.Delete(T, connectorID));
        }

        #endregion Connectors*/
    }
}